package com.zjzywl.smoke.controller;

import com.zjzywl.smoke.config.AppConfig;
import javax.websocket.server.PathParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.zjzywl.smoke.util.RestResult;

@Controller
@RequestMapping(value = "/orgDev")
public class OrgDevController extends BaseController {
	@Autowired
	private AppConfig appConfig;

	//获取组织下的设备数量
	@RequestMapping(value = "/device/number")
	public ResponseEntity<Long> getOrganizationDeviceNumber(@PathParam("id") Integer id ) {
		ResponseEntity<Long> orgs = appConfig.restTemplate().getForEntity(appConfig.getGetDataIp()
				+ "/orgDev/device/number?id=" + id, Long.class);
		return RestResult.OK(orgs.getBody());
	}

}
